The present application relates to digital data processing.
A first agent (a source agent, e.g., a thread or an operating system process) sometimes seeks to execute code in a second agent (a target agent, e.g., another thread or operating system process). This can occur, for example, when the code in the source agent seeks to access or make use of a special attribute that is associated with the target agent. The source agent can invoke a function in the target agent in order to execute the code, but before doing so, the source agent must transfer to the target agent the input data (e.g., the input parameters) required by the code to be executed in the target agent. Additionally, output data (e.g., return values) generated by the code may need to be transferred from the target agent back to the source agent.
FIG. 1 depicts a conventional mechanism that can be used to transfer data between agents. The mechanism depicted in FIG. 1 is sometimes referred to as function call or parameter marshaling. In function call marshaling, a first agent 10 invokes a proxy function, which packages the input data into a data structure 102. The data structure 102 is then transferred to a second agent 20, where a stub function converts the data structure 102 into the actual parameters with which the desired function is to be invoked. After the desired function has been executed, return values are processed in a similar manner—a proxy function in the agent 20 packages the return values into a data structure 104, which is then transferred to the agent 10 and converted into data values to be used by the code executing in the agent 10. Function call marshaling is typically used when the source and target agents are in different address spaces (particularly when they are on different machines), but it can also be used when the source and target agents are in the same address space.